<%--
  Created by IntelliJ IDEA.
  User: 陈俊雄
  Date: 2018/2/24
  Time: 16:23
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link type="text/css" rel="stylesheet" href="css/common/common.css"/>
<!-- Main view -->
<div class="animated fadeInRight">
    <div class="wrapper wrapper-content ng-scope">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>{{ 'CHANNEL_RATE' | translate }}：</h5>
                    </div>
                    <div class="ibox-content sk-loading" ng-controller="channelRateInfoCtrl">
                        <div class="sk-spinner sk-spinner-wave">
                            <div class="sk-rect1"></div>
                            <div class="sk-rect2"></div>
                            <div class="sk-rect3"></div>
                            <div class="sk-rect4"></div>
                            <div class="sk-rect5"></div>
                        </div>

                        <form name="myform" serializer="searchChannelRate(data)">
                            <div class="row">
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">类型：</span>
                                            <select id="type" class="form-control" name="type" ng-model="type" ng-change="typeChange()" >
                                                <option value=""></option>
                                                <option value="0">通用</option>
                                                <option value="1">原始币种</option>
                                                <option value="2">域名</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">元素类型值：</span>
                                            <select id="generalTypeValue" class="form-control" name="typeValue" ng-model="generalTypeValue" >
                                                <option value=""></option> 
                                                <option value="0">通用</option> 
                                            </select>
                                            <div uib-tooltip="请输入需查的币种"
                                                 angucomplete-alt id="currencyTypeValue"
                                                 input-name="typeValue"
                                                 maxlength="10"
                                                 pause="100"
                                                 auto-match="true"
                                                 selected-object="selectCurrencys"
                                                 local-data="selectCurrencys"
                                                 search-fields="firstValue,name"
                                                 title-field="firstValue"
                                                 description-field="name"
                                                 minlength="0"
                                                 focus-first="true"
                                                 input-class="form-control form-control-small"
                                                 match-class="highlight"
                                                 >
                                            </div>
                                            <div uib-tooltip="未选择商户请输入至少三位关键字，可直接输入商户号搜索域名，若商户不存在则不可输入！"
                                                 angucomplete-alt id="siteTypeValue"
                                                 input-name="typeValue"
                                                 maxlength="40"
                                                 pause="100"
                                                 auto-match="true"
                                                 selected-object="selectWebsite"
                                                 local-data="websites"
                                                 search-fields="id,siteUrl"
                                                 title-field="siteUrl"
                                                 description-field="merId"
                                                 minlength="minText"
                                                 focus-first="true"
                                                 input-class="form-control form-control-small"
                                                 match-class="highlight"
                                                 disable-input="webDisable"
                                                 ng-model="typeValue" 
                                                 ng-mousedown="siteTypeMousedown()"
                                                 >
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">商户号：</span>
                                            <div uib-tooltip="可通过商户名称搜索商户号"
                                                 angucomplete-alt id="elementValue"
                                                 input-name="elementValue"
                                                 maxlength="10"
                                                 pause="100"
                                                 auto-match="true"
                                                 selected-object="selectedMerchant"
                                                 local-data="merchants"
                                                 search-fields="id,name"
                                                 title-field="id"
                                                 description-field="name"
                                                 minlength="0"
                                                 focus-first="true"
                                                 input-class="form-control form-control-small"
                                                 match-class="highlight"
                                                 ng-model="elementValue"
                                                 ng-click="elementValueChange()"
                                                 >
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">创建人：</span>
                                            <input type="text" id="creator" name="creator" value=""
                                                   class="form-control">
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">最后修改人：</span>
                                            <input type="text" id="modifier" name="modifier" value=""
                                                   class="form-control">
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">创建起始日期：</span>
                                            <input type="text" id="minCreateTime" name="minCreateTime"
                                                   uib-tooltip="可只选择创建起始日期查询起始日期至今数据"
                                                   class="form-control" ng-readonly="true" ng-click="openDatepicker1()"
                                                   uib-datepicker-popup="{{format}}" ng-model="minCreateTime"
                                                   is-open="popup1.opend"
                                                   datepicker-options="dateOptions1"
                                                   close-text="关闭" alt-input-formats="altInputFormats"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
                                            <button type="button" class="btn btn-default btn-sm no-margins"
                                                    ng-click="openDatepicker1()">
                                                <i class="fa fa-calendar"></i>
                                            </button>
                                        </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">创建结束日期：</span>
                                            <input type="text" id="maxCreateTime" name="maxCreateTime"
                                                   class="form-control" ng-readonly="true" ng-click="openDatepicker2()"
                                                   uib-datepicker-popup="{{format}}" ng-model="maxCreateTime"
                                                   is-open="popup2.opend"
                                                   datepicker-options="dateOptions2"
                                                   close-text="关闭" alt-input-formats="altInputFormats"
                                                   ng-disabled="maxCreateTimeDisable"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
                                            <button type="button" class="btn btn-default btn-sm no-margins"
                                                    ng-click="openDatepicker2()"
                                                    ng-disabled="maxCreateTimeDisable">
                                                <i class="fa fa-calendar"></i>
                                            </button>
                                        </span>
                                        </div>
                                    </div>
                                 </div>
                                 <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">修改起始日期：</span>
                                            <input type="text" id="minModifyTime" name="minModifyTime"
                                                   uib-tooltip="可只选择修改起始日期查询起始日期至今数据"
                                                   class="form-control" ng-readonly="true" ng-click="openDatepicker3()"
                                                   uib-datepicker-popup="{{format}}" ng-model="minModifyTime"
                                                   is-open="popup3.opend"
                                                   datepicker-options="dateOptions3"
                                                   close-text="关闭" alt-input-formats="altInputFormats"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
	                                            <button type="button" class="btn btn-default btn-sm no-margins"
	                                                    ng-click="openDatepicker3()">
	                                                <i class="fa fa-calendar"></i>
	                                            </button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">修改结束日期：</span>
                                            <input type="text" id="maxModifyTime" name="maxModifyTime"
                                                   class="form-control" ng-readonly="true" ng-click="openDatepicker4()"
                                                   uib-datepicker-popup="{{format}}" ng-model="endDate"
                                                   is-open="popup4.opend"
                                                   datepicker-options="dateOptions4"
                                                   close-text="关闭" alt-input-formats="altInputFormats"
                                                   ng-disabled="maxModifyTimeDisable"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
                                            <button type="button" class="btn btn-default btn-sm no-margins"
                                                    ng-click="openDatepicker4()"
                                                    ng-disabled="maxModifyTimeDisable">
                                                   <i class="fa fa-calendar"></i>
                                            </button>
                                        </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6 col-md-6 col-lg-3 col-lg-offset-3">
                                    <button type="submit" class="btn btn-sm btn-w-m btn-primary pull-right general-btn">
                                                                                                                                 查询
                                    </button>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <button type="button" class="btn btn-sm btn-w-m btn-info general-btn"
                                            ng-click="resetForm()">
                                                                                                                                 重置
                                    </button>
                                </div>
                                <div class="pull-right col-sm-6 col-md-6 col-lg-3">
                                    <button type="button" class="pull-right btn btn-sm btn-sm btn-success export-btn"
                                            ng-click="exportCsv()">
                                        <i class="fa fa-download"></i>&nbsp;导出数据
                                    </button>
                                </div>
                            </div>
                        </form>
                        <div class="hr-line-dashed"></div>
                        <%-- ng_table --%>
                        <button class="btn btn-sm btn-primary add-btn" ng-click="showAddModal()">新增</button>
                        <div class="table-responsive">
                            <table ng-table="channelRateTable"
                                   class="table table-condensed table-striped table-hover table-bordered">
                                <tr ng-repeat="row in $data">
                                    <td class="text-center"
                                        data-title="''">
                                        <input type="checkbox" id="channelRateCheckBoxID" ng-model="channelRateCheckBox" ng-click="collectSelectRows($event,row.id)" />
                                    </td>
                                    <td class="text-center" data-title="'类型'">
                                        {{row.type | enumParamsFilter:[{0:"通用",1:"原始币种",2:"域名"}]}}
                                    </td>
                                    <td class="text-center" data-title="'元素类型值'">
                                        {{row.typeValueName}}
                                    </td>
                                    <td class="text-center" data-title="'商户号'">
                                        {{row.elementValue}}
                                    </td>
                                    <td class="text-center" data-title="'上抛点数'">
                                        {{row.upPercent}}
                                    </td>
                                    <td class="text-center" data-title="'创建人'">
                                        {{row.creator}}
                                    </td>
                                    <td class="text-center" data-title="'创建时间'">
                                        {{row.createTime | date:'yyyy/MM/dd hh:mm:ss'}}
                                    </td>
                                    <td class="text-center" data-title="'修改人'">
                                        {{row.modifier}}
                                    </td>
                                    <td class="text-center" data-title="'修改时间'">
                                        {{row.modifyTime| date:'yyyy/MM/dd hh:mm:ss'}}
                                    </td>
                                    <td class="text-center p-6" data-title="'操作'">
                                        <channel_rate></channel_rate>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <my-pagination table-param="channelRateTable"></my-pagination>
                        <button class="btn btn-sm btn-primary marginTop-minus del-btn" ng-click="batchDel()" ng-disabled="delDisabled" >删除</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>